#include "tcpServer.hpp"

static void usage(const std::string& process)
{
    std::cout << "\nUsage: " << process << " port" << std::endl;
}

void test(int a)
{
    std::cout << "测试" << std::endl;
}

int main(int argc,char* argv[])
{
    if(argc != 2)
    {
        usage(argv[0]);
        exit(1);
    }

    //网络功能
    std::unique_ptr<TcpServer> server_ptr(new TcpServer(atoi(argv[1])));
    //将网络功能与服务功能进行解耦
    //服务功能
    server_ptr->bindServer(test);
    server_ptr->start();
    return 0;
}